<%--
  Created by IntelliJ IDEA.
  User: DELL
  Date: 2018/5/31
  Time: 14:21
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<head>
    <meta charset="UTF-8">
    <title>理赔饼图</title>
    <script src="/static/plugins/eCharts/echarts-all.js"></script>
</head>
<body>
<div id="main" style="height:500px ; width:600px"></div>
<script>
    var myChart = echarts.init(document.getElementById('main'));
    option = {
        title: {
            text: '理赔报表',
            subtext: '${groupBy}',
            x: 'center'
        },
        tooltip: {
            trigger: 'item',
            formatter: "{a} <br/>{b} : {c} ({d}%)"
        },
        legend: {
            orient: 'vertical',
            x: 'left',
            data: ${totalAmounts}
        },
        toolbox: {
            show: true,
            feature: {
                mark: {show: true},
                dataView: {show: true, readOnly: false},
                magicType: {
                    show: true,
                    /*funnel 漏斗图*/
                    type: ['pie', 'funnel'],
                    option: {
                        funnel: {
                            x: '25%',
                            width: '50%',
                            funnelAlign: 'left',
                            max:${max}
                        }
                    }
                },
                restore: {show: true},
                saveAsImage: {show: true}
            }
        },
        calculable: true,
        series: [
            {
                name: '${groupBy}',
                type: 'pie',
                radius: '40%',
                center: ['50%', '60%'],
                data: ${totalAmounts}
            }
        ]
    };
    // 为echarts对象加载数据
    myChart.setOption(option);
</script>
</body>
</html>
